function _(e) {
    return document.querySelector(e);
}
_('#btnAdd').onclick = function () {
    var strKey = _('#key').value;
    var strValue = _('#value').value;
    localStorage.setItem(strKey, strValue);
    alert('保存成功~~!');
};
_('#btnGet').onclick = function () {
    var strKey = _('#key').value;
    var strValue = localStorage.getItem(strKey);
    alert('取出的数据是:' + strValue);
};
_('#btnRemove').onclick = function () {
    var strKey = _('#key').value;
    localStorage.removeItem(strKey);
    alert('您删除的数据是:' + strKey);
};
_('#btnClear').onclick = function () {
    localStorage.clear();
};
_('#btnAddObj').onclick = function () {
    var strKey = _('#key').value;
    var objValue = _('#value').value;
    localStorage.setItem(strKey, JSON.stringify(objValue));
    alert('保存成功啦');
};
_('#btnGetObj').onclick = function () {
    var strKey = _('#key').value;
    var objValue = localStorage.getItem(strKey);
    alert('取数据成功啦:' + objValue);
    console.log(JSON.parse(objValue));
};
